package com.mapforge.collection;
/**
* The {@link InstanceProvider} interface represents an {@link Object} that can
* provide {@link Object} instances of the given parameterized type. These
* instances need not be the same instance, but calls to {@link #getInstance()}
* should return {@link Object} instances that are effectively equivalent.
*
* It is recommended, though not required, that the
* {@link Object#equals(Object) equals} method be overridden on these
* {@link Object} instances accordingly, such that {@link Object} instances
* retrieved by {@link #getInstance()} that are not the same {@link Object} are
* still {@link Object#equals(Object) equal}.
*
* @param <T>
*            The supported parameterized {@link Object} type of this
*            {@link InstanceProvider} instance.
*
*/
public interface InstanceProvider<T> {

    /**
     * Returns a non-null {@link Object} of the parameterized type that may
     * represent a different instance than the previous call to
     * {@link #getInstance()}, but both {@link Object} instances returned may be
     * used interchangeably.
     *
     * @return A non-null {@link Object} of the parameterized type that may
     *         represent a different instance than the previous call to
     *         {@link #getInstance()}, but both {@link Object} instances
     *         returned may be used interchangeably.
     */
	public T getInstance();
}
